import django.forms as forms
from django_utils.form_helpers import DivForm,  FormValidator,  RecaptchaForm
from django.utils.translation import ugettext as _

from core.config import MODE_CHOICES
from django_utils import form_widgets

class RequestForm(RecaptchaForm):
    name = forms.CharField(max_length = 70,  min_length = 3,  required = True,  
                           label = _('Name'),  
                           widget = form_widgets.StandardCharfield(attrs={'class':'required',  'minlength':'3'}))
    url = forms.URLField(max_length = 200,  min_length = 5,  required = False,  
                            label = _('URL'), 
                            help_text = _('URL which this feature or bug related to.  Not required.'),
                            widget = form_widgets.StandardCharfield(attrs={'minlength':'3'}))
    mode = forms.ChoiceField(choices = MODE_CHOICES,  
                            label = _('Mode'), 
                            help_text = _('Feature request or bug report?'),
                            required = True)
    description = forms.CharField(max_length = 50000,  
                                min_length = 5, 
                                widget = form_widgets.GiantTextarea(attrs={'class':'required',  'minlength':'5'}), 
                                required = True, 
                                label = _('Description'), 
                                help_text = _('Whats is this bug or feature? Be descriptive. Required.'))
    tags = forms.CharField(max_length = 200, 
                                required = True, 
                                widget = form_widgets.StandardCharfield(attrs={'class':'required'}), 
                                help_text = _('Combine multiple words into single-words separated by commas. Maximum five. At least one required.'))
    captcha = forms.CharField(label = _('Are you human?'), widget = form_widgets.RecaptchaField(),  required = False)